import type { RouteRecordRaw } from 'vue-router';

// const modules = import.meta.glob('../views/**/*.vue');
export const routes: Readonly<RouteRecordRaw[]> = [
  {
    path: '/login',
    name: 'Login',
    meta: { title: '登录页面' },
    component: () => import('@/views/common/Login.vue'),
  },
  {
    path: '/',
    name: 'Layout',
    meta: { title: '网站主页' },
    component: () => import('@/layout/index.vue'),
    redirect: '/home',
    children: [
      {
        path: 'home',
        name: 'home',
        meta: { title: '网站主页' },
        component: () => import('@/views/index.vue'),
      },
      {
        path: 'system',
        name: 'system',
        meta: { title: '系统设置' },
        redirect: '/system/user',
        children: [
          {
            path: 'user',
            name: 'systemPerson',
            meta: { title: '用户管理' },
            component: () => import('@/views/system/user/index.vue'),
          },
          {
            path: 'equipment',
            name: 'systemEquipment',
            meta: { title: '设备管理' },
            component: () => import('@/views/system/equipment/index.vue'),
          },
          {
            path: 'material',
            name: 'systemMaterial',
            meta: { title: '耗材管理' },
            component: () => import('@/views/system/material/index.vue'),
          },
        ],
      },
    ],
  },
];
